package com.dlc.beijingrfid.adapter;


import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.dlc.beijingrfid.R;

import java.text.SimpleDateFormat;

/**
 * Created by John on 2017/6/13.
 */

public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.MessageViewHolder> {
    private Context context;
    private LayoutInflater inflater;

    private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public MessageAdapter(Context context) {
        this.context = context;
        this.inflater=LayoutInflater.from(context);
    }

    @Override
    public MessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new MessageViewHolder(inflater.inflate(R.layout.item_msg,parent,false)) ;
    }

    @Override
    public void onBindViewHolder(MessageViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 6;
    }

    /*   @Override
       protected void inflateItem(BaseListAdpater.ListViewHolder holder, int position) {

           MsgData notiData = getItem(position);
           holder.setText(R.id.tv_title, notiData.getTitle());
           holder.setText(R.id.tv_content, notiData.getContent());
           holder.setText(R.id.tv_time, TIME_FORMAT.format(notiData.getCreateTime()));
           holder.getView(R.id.iv_msg_state).setEnabled(notiData.getRead() == 0);
       }

       @Override
       public int getItemLayoutId(int viewType) {
           return R.layout.item_msg;
       }*/
    class MessageViewHolder extends RecyclerView.ViewHolder{

        public MessageViewHolder(View itemView) {
            super(itemView);
        }
    }


}
